<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class template buffer</title>
<link rel="stylesheet" href="../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../index.html" title="ODTONE 0.4">
<link rel="up" href="../odtone_base_library.html#header..home.carlos.Projectos.odtone.inc.odtone.buffer_hpp" title="Header &lt;/home/carlos/Projectos/odtone/inc/odtone/buffer.hpp&gt;">
<link rel="prev" href="bind_rv_.html" title="Struct template bind_rv_">
<link rel="next" href="buffer_vla.html" title="Class template buffer_vla">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="'ODTONE - Open Dot Twenty One'" width="100" height="100" src=".././images/logo.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="bind_rv_.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../odtone_base_library.html#header..home.carlos.Projectos.odtone.inc.odtone.buffer_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="buffer_vla.html"><img src="../images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="odtone.buffer"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template buffer</span></h2>
<p>odtone::buffer</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../odtone_base_library.html#header..home.carlos.Projectos.odtone.inc.odtone.buffer_hpp" title="Header &lt;/home/carlos/Projectos/odtone/inc/odtone/buffer.hpp&gt;">/home/carlos/Projectos/odtone/inc/odtone/buffer.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="buffer.html" title="Class template buffer">buffer</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// <a class="link" href="buffer.html#odtone.bufferconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="buffer.html#idp3433040-bb"><span class="identifier">buffer</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="buffer.html" title="Class template buffer">buffer</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="buffer.html#idp3706184-bb"><span class="identifier">buffer</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="buffer.html#idp3706528-bb"><span class="identifier">buffer</span></a><span class="special">(</span><a class="link" href="buffer.html" title="Class template buffer">buffer</a> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="buffer.html#idp3707632-bb"><span class="identifier">buffer</span></a><span class="special">(</span><span class="identifier">size_t</span><span class="special">)</span><span class="special">;</span>
  buffer&amp; <a class="link" href="buffer.html#idp3433672-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="buffer.html" title="Class template buffer">buffer</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  buffer&amp; <a class="link" href="buffer.html#idp3708888-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="buffer.html" title="Class template buffer">buffer</a> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="buffer.html#idp3708632-bb"><span class="special">~</span><span class="identifier">buffer</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="buffer.html#idp3431816-bb">private member functions</a></span>
   <a class="link" href="buffer.html#idp3432000-bb"><span class="identifier">ODTONE_STATIC_ASSERT</span></a><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_pod</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span><span class="special">,</span> <span class="string">"T must be POD type"</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="buffer.html#idp3434304-bb">public member functions</a></span>
  <span class="keyword">void</span> <a class="link" href="buffer.html#idp3434488-bb"><span class="identifier">size</span></a><span class="special">(</span><span class="identifier">size_t</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="buffer.html#idp3435952-bb"><span class="identifier">zero</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">T</span> <span class="special">*</span> <a class="link" href="buffer.html#idp3436680-bb"><span class="identifier">get</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">const</span> <span class="identifier">T</span> <span class="special">*</span> <a class="link" href="buffer.html#idp3704072-bb"><span class="identifier">get</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">size_t</span> <a class="link" href="buffer.html#idp3705128-bb"><span class="identifier">size</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp9639704"></a><h2>Description</h2>
<p>A container for data of a specific data type with linear and finite sequence of elements. </p>
<div class="refsect2">
<a name="idp9640136"></a><h3>
<a name="odtone.bufferconstruct-copy-destruct"></a><code class="computeroutput">buffer</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idp3433040-bb"></a><span class="identifier">buffer</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="buffer.html" title="Class template buffer">buffer</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><a name="idp3706184-bb"></a><span class="identifier">buffer</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Construct an empty buffer. The created buffer will be empty and with zero length. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp3706528-bb"></a><span class="identifier">buffer</span><span class="special">(</span><a class="link" href="buffer.html" title="Class template buffer">buffer</a> <span class="special">&amp;&amp;</span> buff<span class="special">)</span><span class="special">;</span></pre>
<p>Construct a buffer. The new created buffer will be a copy of another buffer.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">buff</code></span></p></td>
<td><p>Buffer to copy. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp3707632-bb"></a><span class="identifier">buffer</span><span class="special">(</span><span class="identifier">size_t</span> len<span class="special">)</span><span class="special">;</span></pre>
<p>Construct an empty buffer. Although the created buffer is empty, it has the length defined at its creation.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">len</code></span></p></td>
<td><p>Number of elements the buffer can store. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem"><pre class="literallayout">buffer&amp; <a name="idp3433672-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="buffer.html" title="Class template buffer">buffer</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout">buffer&amp; <a name="idp3708888-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="buffer.html" title="Class template buffer">buffer</a> <span class="special">&amp;&amp;</span> buff<span class="special">)</span><span class="special">;</span></pre>
<p>Copy the elements from another buffer. The elements contained in the buffer will be overwrited.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">buff</code></span></p></td>
<td><p>The buffer from which to copy the elements. </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The reference to the buffer. </p></td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp3708632-bb"></a><span class="special">~</span><span class="identifier">buffer</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Destruct a buffer. </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp9665448"></a><h3>
<a name="idp3431816-bb"></a><code class="computeroutput">buffer</code> private member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><pre class="literallayout"> <a name="idp3432000-bb"></a><span class="identifier">ODTONE_STATIC_ASSERT</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_pod</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span><span class="special">,</span> <span class="string">"T must be POD type"</span><span class="special">)</span><span class="special">;</span></pre></li></ol></div>
</div>
<div class="refsect2">
<a name="idp9671408"></a><h3>
<a name="idp3434304-bb"></a><code class="computeroutput">buffer</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp3434488-bb"></a><span class="identifier">size</span><span class="special">(</span><span class="identifier">size_t</span> len<span class="special">)</span><span class="special">;</span></pre>
<p>Set the number of elements the buffer can store.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">len</code></span></p></td>
<td><p>The number of elements the buffer can store. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp3435952-bb"></a><span class="identifier">zero</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Remove all stored elements from the buffer. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">T</span> <span class="special">*</span> <a name="idp3436680-bb"></a><span class="identifier">get</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Get the pointer to the first element of the buffer.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The pointer to the first element of the buffer. </p></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">const</span> <span class="identifier">T</span> <span class="special">*</span> <a name="idp3704072-bb"></a><span class="identifier">get</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Get the pointer to the first element of the buffer.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The pointer to the first element of the buffer. </p></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_t</span> <a name="idp3705128-bb"></a><span class="identifier">size</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Get the number of elements the buffer can store.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The number of elements the buffer can store. </p></td>
</tr></tbody>
</table></div>
</li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2012 Universidade
      Aveiro<br>Copyright &#169; 2009-2012 Instituto
      de Telecomunica&#231;&#245;es - P&#243;lo Aveiro<p>
        This software is distributed under a license. The full license agreement
        can be found in the LICENSE in this distribution. This software may not be
        copied, modified, sold or distributed other than expressed in the named license
        agreement. This software is distributed without any warranty.
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="bind_rv_.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../odtone_base_library.html#header..home.carlos.Projectos.odtone.inc.odtone.buffer_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="buffer_vla.html"><img src="../images/next.png" alt="Next"></a>
</div>
</body>
</html>
